package com.wmh.baseservice.admin.convert.admin;

import com.wmh.baseservice.admin.entity.AdInfo;
import com.wmh.baseservice.admin.entity.AdMenu;
import com.wmh.baseservice.admin.pojo.vo.user.AdminSimpleInfoRespVO;
import com.wmh.baseservice.admin.pojo.vo.user.CreateAdminReqVO;
import com.wmh.baseservice.admin.pojo.vo.user.UpdateAdminReqVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @author 谢骏
 * @date 2023/8/16 15:44
 **/
@Mapper
public interface AdminConvert {
    AdminConvert INSTANCE = Mappers.getMapper(AdminConvert.class);

    @Mapping(source = "adInfo.id",target = "adId")
    AdminSimpleInfoRespVO convert(AdInfo adInfo, List<String> roleNames, List<String> permissions, List<AdMenu> routeList);


    AdInfo convertDO(CreateAdminReqVO reqVO);

    AdInfo convertDO(UpdateAdminReqVo reqVo);
}
